home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_aet_minisophcut.cog < prev    next >
Text File  |  1999-11-15  |  5KB  |  232 lines

  1. # Jones 3D Cog Script
  2. #
  3. # aet_MiniSophCut.cog
  4. #
  5. # [TL & revised by HB]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11.  
  12. message        startup
  13. message        entered
  14. message        user0                                    # Message for destroying plates.
  15. message        user1                                    # Message for destroying plates.
  16. message        user2                                    # Message for destroying plates.
  17.  
  18.  
  19. keyframe    in_rtarmup=0in_armsout_1_1.key    local    
  20.  
  21.  
  22. sound        success_cue=mus_gen_awechord1.wav    local
  23. sound        end_cue=mus_gen_awechord2.wav    local
  24.  
  25. sound        sophia=AT04J01.WAV                local
  26. sound        getMeOut=AT04S02.WAV            local    # 5.3s
  27.  
  28.  
  29. thing        player                            local
  30. thing        indy1                                    # Indy actor
  31. thing        soph0                            nolink    # Sophia actor
  32.  
  33. thing        plate0                                    # trigger plate                        
  34. thing        plate1                                    # trigger plate
  35. thing        plate2                                    # trigger plate
  36.  
  37. thing        cam1                            nolink
  38. thing        cam1_target                        nolink
  39. thing        cagetarg                        nolink
  40.  
  41. thing        offsetcam                        local    # create on fly
  42.  
  43.  
  44. sector        camsector                        local    # create on fly
  45.  
  46. template    tpl_ghost=ghost                    local
  47.  
  48.  
  49. vector        v_camspot                        local
  50.  
  51. flex        viewangle                        local
  52.  
  53. int            done0=0                            local    # Flag for when scene is done.
  54. int            curcam                            local
  55. int            cursound                        local
  56. int            sender                            local
  57. int            offcamexists=0                    local
  58. int            plate0zapped=0                    local
  59. int            plate1zapped=0                    local
  60. int            plate2zapped=0                    local
  61.             
  62. end
  63.  
  64. # ==============================================================================
  65.  
  66. code
  67.  
  68. # ..............................................................................
  69.  
  70. startup:
  71.  
  72. player = GetLocalPlayerThing();
  73.  
  74. SetThingFlags(plate2, 0x40);
  75. SetThingFlags(plate1, 0x40);
  76. SetThingFlags(plate0, 0x40);
  77.  
  78. return;
  79.  
  80. # ..............................................................................
  81.  
  82. user0:
  83.  
  84.     if (plate0zapped == 0)
  85.     {
  86.         DestroyThing(plate0);
  87.         plate0zapped = 1;
  88.     }
  89.  
  90.     return;
  91.  
  92. # ..............................................................................
  93.  
  94. user1:
  95.  
  96.     if (plate1zapped == 0)
  97.     {
  98.         DestroyThing(plate1);
  99.         plate1zapped = 1;
  100.     }
  101.  
  102.     return;
  103.  
  104. # ..............................................................................
  105.  
  106. user2:
  107.  
  108.     if (plate2zapped == 0)
  109.     {
  110.         DestroyThing(plate2);
  111.         plate2zapped = 1;
  112.     }
  113.  
  114.     return;
  115.  
  116. # ..............................................................................
  117.  
  118. entered:
  119.     
  120.     sender = GetSenderRef();
  121.     
  122.     if ((sender != plate0) && (sender != plate1) && (sender != plate2)) 
  123.     {
  124.         return;
  125.     }
  126.  
  127.     if (done0 == 1)
  128.     {
  129.         return;
  130.     }
  131.  
  132.     done0 = 1;
  133.     
  134.     MakeMeStop();
  135.     DeselectWeaponWait(player);
  136.     StartCutScene(1);
  137.  
  138.     PlaySoundLocal(success_cue, 1.0, 0.0, 0x0, 0);
  139.     
  140.     curcam = GetCurrentCamera();
  141.     TeleportThing(indy1, player); 
  142.     CopyPlayerHolsters(player, indy1); 
  143.     SetThingFlags(player, 0x80000); 
  144.     ClearThingFlags(indy1, 0x80000);
  145.  
  146.     # Aim Indy...
  147.     AISetLookThingEyeLevel(indy1, cagetarg);
  148.     AIWaitForStop(indy1); 
  149.  
  150.     # Make a camera...
  151.     if (offcamexists != 0)
  152.     {
  153.         DestroyThing(offsetcam);
  154.     }
  155.     offcamexists = 1;
  156.     v_camspot =
  157.         VectorAdd(VectorTransformToOrient(indy1, '0.15 -0.18 0.0'), GetThingPos(indy1));    
  158.     camsector = FindNewSectorFromThing(player, v_camspot);
  159.     offsetcam =
  160.         CreateThingAtPos(tpl_ghost, camsector, v_camspot, '0 0 0');
  161.     CaptureThing(offsetcam);
  162.  
  163.     MakeCamera2LikeCamera1(cam1, cam1_target);
  164.     SetCameraLookInterp(2, 0);
  165.     SetCameraPosInterp(2, 0);
  166.     SetCameraFocus(2, cam1);
  167.     SetCameraSecondaryFocus(2, cam1_target);
  168.     viewangle = GetCameraFOV();
  169.     SetCurrentCamera(2);
  170.     SetCameraFOV(viewangle, 0, 0.0);
  171.     SetCameraLookInterp(2, 1);
  172.     SetCameraPosInterp(2, 1);
  173.     SetCameraInterpSpeed(2, 0.8);
  174.     Sleep(0.01);
  175.  
  176.     # Slide cam out...
  177.     SetCameraFocus(2, offsetcam);
  178.     SetCameraSecondaryFocus(2, cagetarg);
  179.     Sleep(0.4);
  180.     Sleep(0.8);
  181.  
  182.     # Indy: "Sophia...?"
  183.     cursound = PlayVoice(indy1, sophia, 1.0, 0);
  184.     PlayKey(indy1, in_rtarmup, 4, 0x12, 0);
  185.     Sleep(0.3);
  186.  
  187.     # Zoom in...
  188.     SetCameraFOV(35, 1, 5.0);
  189.     WaitForSound(cursound);
  190.  
  191.     # Sophia: "Get me out of here...turning to stone..."
  192.     cursound = PlayVoice(soph0, getMeOut, 1.0, 0);
  193.     WaitForSound(cursound);
  194.     PlaySoundLocal(end_cue, 1.0, 0.0, 0x0, 0);
  195.     Sleep(1.0);    
  196.     
  197.     SetCameraLookInterp(2, 0);
  198.     SetCameraPosInterp(2, 0);
  199.     SetCameraPosition(1, GetThingPos(offsetcam));
  200.     SetCurrentCamera(1);
  201.     ResetCameraFOV(1, 0.5);
  202.  
  203.     TeleportThing(player, indy1);    
  204.     ClearThingFlags(player, 0x80000);
  205.     SetThingFlags(indy1, 0x80000);
  206.  
  207.     if (plate0zapped == 0)
  208.     {
  209.         DestroyThing(plate0);
  210.         plate0zapped = 1;
  211.     }
  212.  
  213.     if (plate1zapped == 0)
  214.     {
  215.         DestroyThing(plate1);
  216.         plate1zapped = 1;
  217.     }
  218.  
  219.     if (plate2zapped == 0)
  220.     {
  221.         DestroyThing(plate2);
  222.         plate2zapped = 1;
  223.     }
  224.     
  225.     EndCutScene();
  226.     ClearActorFlags(player, 0x200000);
  227.  
  228.     return;
  229.  
  230. end
  231.  
  232.